/*
 * @Author: your name
 * @Date: 2021-02-16 13:49:52
 * @LastEditTime: 2021-02-16 20:35:07
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \demo_2021021601\include\common\div64.h
 */
#ifndef __ASM_ARM_DIV64
#define __ASM_ARM_DIV64

extern unsigned int __my_div64_32(unsigned long long *dividend, unsigned int divisor);

#define do_div(n, base) ({                       \
	unsigned int __base = (base);                  \
	unsigned int __rem;                            \
	(void)(((typeof((n)) *)0) == ((uint64_t *)0)); \
	if (((n) >> 32) == 0)                          \
	{                                              \
		__rem = (unsigned int)(n) % __base;          \
		(n) = (unsigned int)(n) / __base;            \
	}                                              \
	else                                           \
		__rem = __my_div64_32(&(n), __base);         \
	__rem;                                         \
})

#endif
